﻿<HDKUI:LayoutAwarePage
    x:Class="HDK.Demo.Shell"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:HDK.Demo"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:HDKUI="using:HDK.UI.Controls"
    mc:Ignorable="d">

    <Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}" x:Name="LayoutRoot">
        <Grid.RowDefinitions>
            <RowDefinition Height="10"/>
            <RowDefinition Height="140"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <!-- Status Panel -->
        <Grid Grid.Row="0" Background="{StaticResource ApplicationPressedForegroundThemeBrush}">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="Auto" MinWidth="100" />
            </Grid.ColumnDefinitions>
            <!-- Left Part -->
            <StackPanel Grid.Column="0" Orientation="Horizontal" HorizontalAlignment="Left">

            </StackPanel>
            <!-- Central Part -->
            <StackPanel Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Center">

            </StackPanel>
            <!-- Right Part -->
            <StackPanel Grid.Column="2" Orientation="Horizontal" HorizontalAlignment="Right">

            </StackPanel>
        </Grid>
        
        <!-- Back button and page title -->
        <Grid Grid.Row="1">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <Button x:Name="backButton" Grid.Column="0" Style="{StaticResource BackButtonStyle}" Command="{Binding GoBackCommand}" CommandParameter="{Binding ElementName=shellFrame}"/>
            <Button x:Name="forwardButton" Grid.Column="1" Style="{StaticResource BackButtonStyle}" Command="{Binding GoForwardCommand}" CommandParameter="{Binding ElementName=shellFrame}" Margin="0,0,36,36" />
            <TextBlock x:Name="pageTitle" Grid.Column="2" Style="{StaticResource PageHeaderTextStyle}" Text="{Binding Path=Content.Title, ElementName=shellFrame}"/>
        </Grid>
        
        <HDKUI:BreadcrumbBar Grid.Row="2" x:Name="breadcrumb" >
        </HDKUI:BreadcrumbBar>
        
        <Frame Grid.Row="3" x:Name ="shellFrame">
        </Frame>

    </Grid>
    
    <VisualStateManager.VisualStateGroups>
        <!-- Visual states reflect the application's view state -->
        <VisualStateGroup x:Name="ApplicationViewStates">
            <VisualState x:Name="FullScreenLandscape"/>
            <VisualState x:Name="Filled"/>

            <!-- The back button respects the narrower 100-pixel margin convention for portrait -->
            <VisualState x:Name="FullScreenPortrait">
                <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="backButton" Storyboard.TargetProperty="Style">
                        <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PortraitBackButtonStyle}"/>
                    </ObjectAnimationUsingKeyFrames>

                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="LayoutRoot" Storyboard.TargetProperty="Visibility">
                        <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
                    </ObjectAnimationUsingKeyFrames>
                </Storyboard>
            </VisualState>

            <!-- The back button and title have different styles when snapped -->
            <VisualState x:Name="Snapped">
                <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="backButton" Storyboard.TargetProperty="Style">
                        <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource SnappedBackButtonStyle}"/>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="pageTitle" Storyboard.TargetProperty="Style">
                        <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource SnappedPageHeaderTextStyle}"/>
                    </ObjectAnimationUsingKeyFrames>

                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="LayoutRoot" Storyboard.TargetProperty="Visibility">
                        <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>
                    </ObjectAnimationUsingKeyFrames>
                </Storyboard>
            </VisualState>
        </VisualStateGroup>
    </VisualStateManager.VisualStateGroups>
</HDKUI:LayoutAwarePage>